package cp3120.ucm.server;

import cp3120.ucm.UCController;
import cp3120.dao.DAOFactory;
import cp3120.dao.mysql.MySQLDAOFactory;
import cp3120.net.AirportServer;

/**
 *
 * User: Rowan Spence
 * Date: 26/05/2009
 * Time: 7:58:18 PM
 * PRECONDITION: A Request to start the server has been made <br>
 * POST-CONDITION: The server has started <br>
 * 1. System sets up the DAO factory<br>
 * 2. System starts the server<br>
 */
public class UCDefaultStartServer implements UCController {
    /**
     * runs this UC
     */
    public void run() {
        // 1. The system will initilize an appropriate DAOFactory.
        DAOFactory.setFactory(new MySQLDAOFactory());

        // 2. The system will create a new instance of the server.
        AirportServer.getInstance().start(7778);
    }
}
